package com.atguigu.lease.common.exception;

import com.atguigu.lease.common.result.ResultCodeEnum;
import lombok.Data;
import org.springframework.core.io.Resource;

/**
 * ClassName: LeaseException
 * Package: com.atguigu.lease.common.exception
 * Description:
 *
 * @Author: tiantian
 * @Create: 2024/10/6 - 22:32
 * @Version: v1.0
 */
//自定义异常类
@Data
public class LeaseException extends RuntimeException{
    //自定义异常，携带一个枚举过来（写一个枚举）
    private ResultCodeEnum resultCodeEnum;

    public LeaseException(String message) {
        super(message);
    }

    //自定义异常做的时候，
    public LeaseException(ResultCodeEnum resultCodeEnum) {
        super(resultCodeEnum.getMessage());
        this.resultCodeEnum = resultCodeEnum;
    }
}
